import request from "src/utils/request";
import type {QueryPageParams} from 'src/types/requestParam'
import type {Comment} from 'src/models/comment'

// 获取评论列表
export const getComments=(params:QueryPageParams)=> {
  return request.fetchPageList(`/comment/public/list`, { params: params });
}
// 获取文章详情
export const getDetail=(id:Number)=> {
  return request.get(`/post/get/${id}`);
}

export const postComment=(comment:Comment)=>{
  return request.post(`/comment/add`,comment);

}
export const likeComment=(id:number)=>{
  return request.post(`/comment/public/${id}/like`);

}


export default{
  getComments,getDetail,postComment,likeComment

}